Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum


  

PreviousPrevious NextNext


~Sven Asafoogenings 20.Jan.04 06:00 PM a Web browser
Domino Designer All Releases Windows 2000


Hello,

I need help with an agent that I am currently working on. I developed the agent using Script(which I am not experienced with) and I'm not sure how to proceed at this point. The purpose of the agent is the following:

It will be triggered manually to run on selected documents in a view that contains student records/names. It should first display a picklist with a list of courses(from another view) and based on the course(s) selected, create a new form 'Student Record for CEU Course' for each student selected and populate the 'Course Num' field with those courses and finally save and close each document.

The Script that I have written I got from reading the help and utilizing bits and pieces of sample code so I'm not sure if it was done correctly but it does work partially. It will display the picklist of courses but after I select the courses, nothing else happens.....any clues as to what I can change or add to the existing code??????? Any help appreciated. Here is the script I have so far:

Sub Initialize
On Error Goto ErrorHandler
REM get the current database from the session
Dim ses As New NotesSession
Dim db As NotesDatabase
Set db = ses.CurrentDatabase

REM get the unprocessed documents
Dim col As NotesDocumentCollection
Set col = db.UnprocessedDocuments

REM process the unprocessed documents
Dim docToProcess As NotesDocument
For docCount=1 To col.Count
REM get the document in the collection to process
Set docToProcess = col.GetNthDocument(docCount)

Print "Processing document "+Cstr(docCount) + " of "+Cstr(col.Count)

Dim newDoc As New NotesDocument(db)
Dim workspace As New NotesUIWorkspace
Dim picklist As Variant
With newDoc
.Form = "Student Record for CEU Course"
picklist = workspace.PickListStrings(PICKLIST_CUSTOM, True, "dcoirm1ln/DC/USEPA/US", _
"QS\OversightTest.nsf", "Training Events\by Code", "Select a training event", _
"Please select a course this student attended",2)
Call newdoc.FieldSetText("Course_Num", picklist)
.ComputeWithForm True,False
.Save True, True
End With
REM update the doc we just processed so we do not process it again
Call ses.UpdateProcessedDoc(docToProcess)
Next
Exit Sub

ErrorHandler:
Print "Error :: " +Error$+" "+Cstr(Err) + " "+Cstr(Erl)
Exit Sub

End Sub0

End Sub


Thanks!






Help with Script Agent to Create Ne... (~Sven Asafoogen... 20.Jan.04)
. . Sure try this instead... (~Dan Elhipister... 20.Jan.04)
. . . . RE: Sure try this instead... (~Sven Asafoogen... 20.Jan.04)
. . . . . . RE: Sure try this instead... (~Justin Minlute... 20.Jan.04)
. . . . . . . . RE: Sure try this instead... (~Sven Asafoogen... 20.Jan.04)





  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Category
Platform
Release
Advanced search

 RSS feedsRSS
All forum posts RSS
All main topics RSS